home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / alpha / modules / resources / card.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  3.3 KB  |  119 lines

  1. MODULE 'exec/interrupts'
  2. #define CARDRESNAME 'card.resource'
  3.  
  4. /* Structures used by the card.resource       */
  5.  
  6. OBJECT CardHandle
  7.  CardNode:Node,
  8.  CardRemoved:PTR TO Interrupt,
  9.  CardInserted:PTR TO Interrupt,
  10.  CardStatus:PTR TO Interrupt,
  11.  CardFlags:UBYTE
  12.  
  13. OBJECT DeviceTData
  14.  DTsize:ULONG,     /* Size in bytes   */
  15.  DTspeed:ULONG,    /* Speed in nanoseconds    */
  16.  DTtype:UBYTE,     /* Type of card      */
  17.  DTflags:UBYTE     /* Other flags     */
  18.  
  19. OBJECT CardMemoryMap
  20.  CommonMemory:PTR TO UBYTE,
  21.  AttributeMemory:PTR TO UBYTE,
  22.  IOMemory:PTR TO UBYTE,           /* Extended for V39 - These are the size of the memory spaces above */
  23.  CommonMemSize:ULONG,
  24.  AttributeMemSize:ULONG,
  25.  IOMemSize:ULONG
  26.  
  27. /* CardHandle.cah_CardFlags for OwnCard() function    */
  28. FLAG CARD_RESETREMOVE,
  29.  CARD_IFAVAILABLE,
  30.  CARD_DELAYOWNERSHIP,
  31.  CARD_POSTSTATUS
  32.  
  33. /* ReleaseCreditCard() function flags       */
  34. FLAG CARD_REMOVEHANDLE
  35.  
  36. /* ReadStatus() return flags          */
  37. CONST CARD_STATUSB_CCDET=6,
  38.  CARD_STATUSF_CCDET=(1<<CARD_STATUSB_CCDET),
  39.  CARD_STATUSB_BVD1=5,
  40.  CARD_STATUSF_BVD1=(1<<CARD_STATUSB_BVD1),
  41.  CARD_STATUSB_SC=5,
  42.  CARD_STATUSF_SC=(1<<CARD_STATUSB_SC),
  43.  CARD_STATUSB_BVD2=4,
  44.  CARD_STATUSF_BVD2=(1<<CARD_STATUSB_BVD2),
  45.  CARD_STATUSB_DA=4,
  46.  CARD_STATUSF_DA=(1<<CARD_STATUSB_DA),
  47.  CARD_STATUSB_WR=3,
  48.  CARD_STATUSF_WR=(1<<CARD_STATUSB_WR),
  49.  CARD_STATUSB_BSY=2,
  50.  CARD_STATUSF_BSY=(1<<CARD_STATUSB_BSY),
  51.  CARD_STATUSB_IRQ=2,
  52.  CARD_STATUSF_IRQ=(1<<CARD_STATUSB_IRQ),
  53.  
  54. /* CardProgramVoltage() defines */
  55.  CARD_VOLTAGE_0V=0,  /* Set to default; may be the same as 5V */
  56.  CARD_VOLTAGE_5V=1,
  57.  CARD_VOLTAGE_12V=2,
  58.  
  59. /* CardMiscControl() defines */
  60.  CARD_ENABLEB_DIGAUDIO=1,
  61.  CARD_ENABLEF_DIGAUDIO=(1<<CARD_ENABLEB_DIGAUDIO),
  62.  CARD_DISABLEB_WP=3,
  63.  CARD_DISABLEF_WP=(1<<CARD_DISABLEB_WP),
  64.  
  65. /*
  66.  * New CardMiscControl() bits for V39 card.resource.  Use these bits to set,
  67.  * or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
  68.  * Write-enable/protect change interrupts are always enabled.  The defaults
  69.  * are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled).
  70.  *
  71.  * IMPORTANT -- Only set these bits for V39 card.resource or greater (check
  72.  * resource base VERSION)
  73.  *
  74.  */
  75.  CARD_INTB_SETCLR=7,
  76.  CARD_INTF_SETCLR=(1<<CARD_INTB_SETCLR),
  77.  CARD_INTB_BVD1=5,
  78.  CARD_INTF_BVD1=(1<<CARD_INTB_BVD1),
  79.  CARD_INTB_SC=5,
  80.  CARD_INTF_SC=(1<<CARD_INTB_SC),
  81.  CARD_INTB_BVD2=4,
  82.  CARD_INTF_BVD2=(1<<CARD_INTB_BVD2),
  83.  CARD_INTB_DA=4,
  84.  CARD_INTF_DA=(1<<CARD_INTB_DA),
  85.  CARD_INTB_BSY=2,
  86.  CARD_INTF_BSY=(1<<CARD_INTB_BSY),
  87.  CARD_INTB_IRQ=2,
  88.  CARD_INTF_IRQ=(1<<CARD_INTB_IRQ),
  89.  
  90. /* CardInterface() defines */
  91.  CARD_INTERFACE_AMIGA_0=0,
  92. /*
  93.  * Tuple for Amiga execute-in-place software (e.g., games, or other
  94.  * such software which wants to use execute-in-place software stored
  95.  * on a credit-card, such as a ROM card).
  96.  *
  97.  * See documentatin for IfAmigaXIP().
  98.  */
  99.  CISTPL_AMIGAXIP=$91
  100.  
  101. OBJECT TP_AmigaXIP
  102.  TPL_CODE:UBYTE,
  103.  TPL_LINK:UBYTE,
  104.  TP_XIPLOC[4]:UBYTE,
  105.  TP_XIPFLAGS:UBYTE,
  106.  TP_XIPRESRV:UBYTE
  107.  
  108. /*
  109.   ; The XIPFLAGB_AUTORUN bit means that you want the machine
  110.   ; to perform a reset if the execute-in-place card is inserted
  111.   ; after DOS has been started.  The machine will then reset,
  112.   ; and execute your execute-in-place code the next time around.
  113.   ;
  114.   ; NOTE -- this flag may be ignored on some machines, in which
  115.   ; case the user will have to manually reset the machine in the
  116.   ; usual way.
  117. */
  118. FLAG XIPFLAGS_AUTORUN
  119.